package com.cdks.wuxiu.entity.mongodb;

import lombok.Data;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;

import com.fasterxml.jackson.annotation.JsonInclude;


/**
 * 心情语音转译信息
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Document(collection = "chat_message_info")  //指定要对应的文档名(表名）
public class ChatMessageInfo {

    /*** 自定义mongo主键 加此注解可自定义主键类型以及自定义自增规则
     *  若不加 插入数据数会默认生成 ObjectId 类型的_id 字段
     *  org.springframework.data.annotation.Id 包下
     *  mongo库主键字段还是为_id (本文实体类中字段为为id，意思查询字段为_id，但查询结果_id会映射到实体对象id字段中）
     */
    /**
     * 自增主键
     */
    @Id
    private String id;

    /**
     * 创建unix时间
     */
    @Field(name = "createTime", targetType = FieldType.INT64)
    private Long createTime;

    /**
     * 更新日期
     */
    @Field(name = "updateTime" , targetType = FieldType.STRING)
    private String updateTime;

    /**
     * 发送人id
     */
    @Field(name = "senderId", targetType = FieldType.INT64)
    private Long senderId;

    /**
     * 接收人id
     */
    @Field(name = "recverId", targetType = FieldType.INT64)
    private Long recverId;  
    
    /**
     * 消息类型
     */
    @Field(name = "type", targetType = FieldType.INT32)
    private Integer type;
    
    /**
     * 消息内容
     */
    @Field(name = "content", targetType = FieldType.STRING)
    private String content;
    
    /**
     * 审核状态
     */
    @Field(name = "status", targetType = FieldType.INT32)
    private Integer status;
    
    /**
     * 审核人
     */
    @Field(name = "auditor", targetType = FieldType.STRING)
    private Integer auditor;        
}
